package tests;

import java.lang.reflect.*;
import tester.*;

@Example
public class ReflectionExample {
	
	public ReflectionExample(){}
	
	@TestMethod
	public void test(Tester t){
		try{
			Num num = new Num(5);
			Field f = num.getClass().getDeclaredField("val");
			Object val = f.get(num);
			Object val2 = f.get(num);
			t.checkFail(val == val2, true);
			t.checkExpect(val.equals(val2), true);
			t.checkExpect(val.equals(5), true);
			t.checkExpect(val, new Integer(5));
		}catch(Throwable e){
			
		}
		
	}
	
	public static void main(String[] args){
		Tester.runFullReport(new ReflectionExample());
	}
	
	
}

class Num{
	int val;
	public Num(int val){
		this.val = val;
	}
}
